﻿using Service.DI;
using Service.Server.Ultrasound;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using ViewModel;
using ViewModel.Ultrasound;

namespace RapidProject.Pages.Ultrasound
{
    /// <summary>
    /// UltrasoundView.xaml 的交互逻辑
    /// </summary>
    public partial class UltrasoundView : Page, ISingletonService
    {
        private UltrasoundViewModel _ultrasoundViewModel;
        private IUltrasoundServer _ultrasoundServer;
        private MainWindowViewModel _mainWindowViewModel;
        public UltrasoundView(UltrasoundViewModel viewModel, MainWindowViewModel mainWindowViewModel, IUltrasoundServer ultrasoundServer)
        {
            InitializeComponent();
            DataContext = viewModel;
            _ultrasoundViewModel = viewModel;
            _mainWindowViewModel = mainWindowViewModel;
            _ultrasoundServer = ultrasoundServer;
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            _ultrasoundServer.CheckDev();
            _ultrasoundViewModel.CheckDev();
            _mainWindowViewModel.StrTitle = "检查完毕";
            //MessageBox.Show("检查完毕");
        }

        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            _ultrasoundServer.ExecDev();
            _ultrasoundViewModel.ExecDev();
            _mainWindowViewModel.StrTitle = "执行完毕";
            //MessageBox.Show("执行完毕");
        }
    }
}
